# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time
  include AuthenticatedSystem # for the authentication process
  
  def login_required
  	 true
  end
  
  def access_denied
  	super
  	flash[:error] = 'gots to logs in buddy'
  end
  
  before_filter :fetch_categories, :set_local, :fetch_series

  def set_local
    Locale.set(session[:locale])
  end

  def fetch_categories
    @categories = Category.find (:all,:order => "name") 
  end
  
  def fetch_series
    @series = Series.find(:all)
  end
  
  # See ActionController::RequestForgeryProtection for details
  # Uncomment the :secret if you're not using the cookie session store
  protect_from_forgery # :secret => 'c045af19e99de6bbebd19c0597832114'
end
